package com.tony.blog.model.mapper;

import com.tony.blog.model.entity.CollectEntity;
import org.apache.ibatis.annotations.Param;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: CollectMapper
 * @Auther: 皮蛋布丁
 * @Date: 2021/08/16/20:21
 * @Description: 收藏表
 */
public interface CollectMapper {

    /**
    * @Description: countByUBlogId 根据博文id获取被收藏的数量
    * @Param: [blogId, userId]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/16 20:22
    */
    Integer countByUBlogId(@Param("blogId") Integer blogId, @Param("userId") Long userId);

    /**
    * @Description: selectByUserBlogId 获取收藏信息
    * @Param: [blogId, userId]
    * @return: com.tony.blog.model.entity.CollectEntity
    * @Author: 皮蛋布丁
    * @Date: 2021/8/31 21:03
    */
    CollectEntity selectByUserBlogId(@Param("blogId") Integer blogId,@Param("userId") Long userId);

    /**
    * @Description: updateByPrimaryKeySelective 更新为已收藏
    * @Param: [collect]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/31 21:11
    */
    Integer updateByPrimaryKeySelective(CollectEntity collect);

    /**
    * @Description: insertSelective 插入已收藏信息
    * @Param: [collect]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/31 21:16
    */
    Integer insertSelective(CollectEntity collect);

    /**
    * @Description: deleteByUserBlogId 取消收藏
    * @Param: [blogId, userId]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/9/2 20:43
    */
    Integer deleteByUserBlogId(@Param("blogId") Integer blogId,@Param("userId") Long userId);
}
